package com.auth.client.config.domain;

import lombok.Data;

import java.util.Arrays;

/**
 * 解析后对象存储
 *
 * @author: mhSui 2020/07/01
 */
@Data
public class User {
    private String id;
    private String mobile;
    private String[] actions;
    private String token;

    public User(String id) {
        this.id = id;
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof User)) {
            return false;
        } else {
            User other = (User)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$id = this.getId();
                Object other$id = other.getId();
                if (this$id == null) {
                    if (other$id != null) {
                        return false;
                    }
                } else if (!this$id.equals(other$id)) {
                    return false;
                }

                Object this$mobile = this.getMobile();
                Object other$mobile = other.getMobile();
                if (this$mobile == null) {
                    if (other$mobile != null) {
                        return false;
                    }
                } else if (!this$mobile.equals(other$mobile)) {
                    return false;
                }

                if (!Arrays.deepEquals(this.getActions(), other.getActions())) {
                    return false;
                } else {
                    Object this$token = this.getToken();
                    Object other$token = other.getToken();
                    if (this$token == null) {
                        if (other$token != null) {
                            return false;
                        }
                    } else if (!this$token.equals(other$token)) {
                        return false;
                    }

                    return true;
                }
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof User;
    }

}
